<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<script>
function validateForm()
{
var x=document.forms["registerUser"]["first_name"].value;
if (x==null || x=="")
  {
  alert("Please Enter Your First Name");
  return false;
  }

var x=document.forms["registerUser"]["last_name"].value;
if (x==null || x=="")
  {
  alert("Please Enter Your Last Name");
  return false;
  }
if ( ( registerUser.sex[0].checked == false ) && ( registerUser.sex[1].checked == false ) ) 
{
alert ( "Are you shemale??" ); 
return false;
}

var x=document.forms["registerUser"]["emailaddress"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
if (x==null || x=="")
  { 
  alert("Please Enter Your Email Address");
  return false;
  }        
var x=document.forms["registerUser"]["password"].value;
if ( x=="" || x==null) 
  { 
  alert("Please Enter a Password");
  return false;
  }  
var y=document.forms["registerUser"]["Repassword"].value;
if ( (x!=y)) 
  { 
  alert("Passwords do not match");
  return false;
  }  
}
</script>
</body>
</html>